package com.firefly.dao.assembler.shop;

import com.firefly.dao.dao.shop.po.AreaPo;
import com.firefly.dao.dto.shop.AreaDto;
import com.firefly.dao.vo.shop.AreaVo;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2023/2/1
 **/
@Component
public class AreaAssembler {
    public AreaVo getVo(AreaPo entity) {
        AreaVo detail = new AreaVo();
        detail.setId(entity.getId());
        detail.setParentId(entity.getParentId());
        detail.setName(entity.getName());
        detail.setDisplay(entity.getDisplay());
        return detail;
    }
    public AreaPo getPo(AreaPo detail){
        AreaPo entity = new AreaPo();
        entity.setId(detail.getId());
        entity.setParentId(detail.getParentId());
        entity.setName(detail.getName());
        entity.setDisplay(detail.getDisplay());
        return entity;
    }
    public AreaPo getPo(AreaDto detail){
        AreaPo entity = new AreaPo();
        entity.setId(detail.getId());
        entity.setDisplay(detail.getDisplay());
        return entity;
    }
}
